import java.util.Scanner;

public class demo24 {
    public volatile static int count=0;
    public static void main(String[] args) {
        //负责读取的线程
        Thread t1=new Thread(()->{
            while(count==0){

            }
            System.out.println("t1线程结束");
        });
        //负责修改的进程
        Thread t2=new Thread(()->{
//            Scanner scanner=new Scanner(System.in);
            System.out.println("请输入修改的count值");
            Scanner scanner=new Scanner(System.in);
            count=scanner.nextInt();
        });
        t1.start();
        t2.start();
    }
}
